<?php
$table=mysql_real_escape_string($table);
$clean=array(); $cols=array(); $vals=array(); $params=array(str_repeat('s',count($data)));
foreach($data as$k=>$v){
	$k=mysql_real_escape_string($k); $v=mysql_real_escape_string($v);
	$clean[$k]=$v; $cols[]=$k; $vals[]=$v;
}
$cols=implode(',',$cols); $vals=implode(',',$vals);


echo'1';
$q=$db->query("insert into $table ($cols) values ($vals)");
echo'2';
//foreach($data as$k=>$v)
//@$q->bind_param(':'.$k,$v);
echo'3';
//$q->execute();
echo'4';
?>